<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <th:block th:include="include :: header('修改维修记录（含申请功能）')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-record-edit" th:object="${maintenanceRecord}">
        <input name="maintenanceId" th:field="*{maintenanceId}" type="hidden">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">关联会议室ID：</label>
                <div class="col-sm-8">
                    <input name="roomId" th:field="*{roomId}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">申请部长ID：</label>
                <div class="col-sm-8">
                    <input name="ministerId" th:field="*{ministerId}" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">问题描述：</label>
                <div class="col-sm-8">
                    <textarea name="problemDescription" class="form-control">[[*{problemDescription}]]</textarea>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">申请时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="applyTime" th:value="${#dates.format(maintenanceRecord.applyTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </div>


        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">完成时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="finishTime" th:value="${#dates.format(maintenanceRecord.finishTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/record";
    $("#form-record-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-record-edit').serialize());
        }
    }

    $("input[name='applyTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='finishTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>

</html>